package com.zzyl;

import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDate;

@SpringBootTest
@Component
@Slf4j
public class MyTask {
    @Scheduled(cron = "0 */5 * * * *")
    public void testTask(){
        log.info("定时任务开始执行{}", LocalDate.now());
    }
}
